const Api = require('./../service/Api')
const { exchange } = require('./index')
const {
    OrderStatus,
    OrderTypeUpper
} = require('./../constants/index')

Api.setState({
    exchange,
    tick: 'BTC/USDT',
    symbol: 'BTCUSDT',
    buildItem: {
        direction: 'buy'
    },
    realAvgPrice: 55500,
    futurePrice: 55600
})

this.$exchange = exchange

// Promise.all([
//     Api.requestEndOrderNow(0.01),
//     Api.requestEndOrderNow(0.01),
//     Api.requestEndOrderNow(0.01),
//     Api.requestEndOrderNow(0.01),
//     Api.requestEndOrderNow(0.01),
//     Api.requestEndOrderNow(0.01),
//     Api.requestEndOrderNow(0.01),
//     Api.requestEndOrderNow(0.01),
//     Api.requestEndOrderNow(0.01)
// ]).then(endOrderList => {
    //撤销所有止盈/止损单
    Api.cancelSomeStopOrders().then(orderList => {
        const orderIdList = orderList.map(item => item.orderId)
        if (orderIdList.length) {
            // this.$exchange.fapiPrivateDeleteBatchOrders({

            // })
        }
    })
// })


